package sismatriculas;

import BE.MenuBE;
import BR.MenuBR;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JMenu;

public class frmPrincipalMDI extends javax.swing.JFrame {
private List<MenuBE> listamenu = new ArrayList();

    private JMenu Menuprincipal;

    public frmPrincipalMDI() {
        initComponents();
        MenuBR menus = new MenuBR();
        listamenu = menus.lista_MenuPrinciapal();
        
        for(MenuBE x : listamenu){
         String nombre = x.getNombre_menu();

        Menuprincipal = new JMenu(); //crear objeto
        Menuprincipal.setName(nombre);
        Menuprincipal.setText(nombre);
        Mimenu.add(Menuprincipal);
        
        
        }
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Mimenu = new javax.swing.JMenuBar();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(".:: Sistema de Matriculas y Notas ::.");
        setJMenuBar(Mimenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 769, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 558, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new frmPrincipalMDI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuBar Mimenu;
    // End of variables declaration//GEN-END:variables

}
